#include <iostream>
using namespace std;
//class Salesman ，请在这里完成Saleman类
class Salesman
{
public:
    static double salesamount;
    static int sum_quantity;

    void CalculateQuantity()
    {
        sum_quantity += this->quantity;
    }

    void CalculateSale()
    {
        salesamount += this->quantity * this->price;
    }

    static double CalculateAveragePrice()
    {
        return salesamount / sum_quantity;
    }

    double num;
    double quantity;
    double price;

};
double Salesman::salesamount = 0;
int Salesman::sum_quantity = 0;
//
int main()
{

    Salesman  sa[3];
    for (int i = 0;i < 3;i++)
    {
        cin >> sa[i].num >> sa[i].quantity >> sa[i].price;
        sa[i].CalculateQuantity();
        sa[i].CalculateSale();
    }
  
    cout << "averageprice=" << Salesman::CalculateAveragePrice();
}